home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_sol_ctrllever2.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
8KB
|
325 lines
# Jones 3D Cog Script
#
# SOL_CtrlLever2.cog
#
# Sets up lever2 in the "pulled" possition (ready for pushing) at level start.
#
# [TRM]
#
# (C) 1999 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message startup
message user0
message activated
thing player local
thing leverGhost # Lever position
thing indy # Actor Indy
thing trkSwitch # Track switch
thing panelTarget # focus for control panel
thing switchCam # Switch cam
thing ctrlCam1 # Control panel cam
thing pushed local
thing pulled local
thing offsetCam
surface switch # Switch texture
# track switches
surface switchA
surface switchB
template tplLevPull=pullever local
template tplLevPush=pushlever local
keyframe leverPull=gen_lever_pull.key local
keyframe leverPush=gen_lever_push.key local
keyframe indyPull=in_pull_lever.key local
keyframe indyPush=in_push_lever.key local
sound sndLever=gen_lever_pull.wav local
sound sndSwitchTex=sol_panel_switch_c.wav local
sound inJuice=Sl02j04.wav local
cog hintCog
int powerOn=0 local
int ready=1 local
int playing=0 local
int curCam local
int sound2 local
# ** subroutines **
flex pullLever local
flex pushLever local
flex noPower local
end
# ========================================================================================
code
startup:
pulled = CreateThing(tplLevPush, leverGhost);
CaptureThing(pulled);
# Mine Track -- Go Straight
SetSurfaceFlags(switchA, 0x4000);
ClearSurfaceFlags(switchB, 0x4000);
return;
# ========================================================================================
user0:
powerOn = 1;
return;
# ========================================================================================
activated:
Print("activated: ctrlLever2");
player = GetLocalPlayerThing();
curCam = GetCurrentCamera();
# no power
if((GetSenderRef() == pulled) && (IsGhostVisible(player, pulled, 50.0)) && (!powerOn) && (!playing))
{
playing = 1;
Call noPower;
}
# push lever
else if((GetSenderRef() == pulled) && (IsGhostVisible(player, pulled, 50.0)) && (powerOn) && (ready))
{
ready = 0;
Call pushLever;
}
# pull lever
else if((GetSenderRef() == pushed) && (IsGhostVisible(player, pushed, 50.0)) && (powerOn) && (ready))
{
ready = 0;
Call pullLever;
}
return;
# ========================================================================================
pushLever:
# do cutscene stuff
MakeMeStop();
StartCutscene(2);
# switch to offsetCam
SetCameraFocus(2, offsetCam);
SetCameraSecondaryFocus(2, player);
SetCurrentCamera(2);
SetCameraFOV(90, 0, 0.0);
# put away any weapon
DeselectWeaponWait(player);
# outfit Indy actor
CopyPlayerHolsters(player, indy);
# show actor hide player
SetThingFlags(player, 0x80000);
ClearThingFlags(indy, 0x80000);
# push the lever
PlayKey(pulled, leverPush, 4, 0x14, 0);
PlayKey(indy, indyPush, 4, 0x12, 0);
Sleep(0.75);
PlaySoundLocal(sndLever, 1.0, 0.0, 0x0, 1);
# Cut to Control Panel cam
SetCameraFocus(2, ctrlCam1);
SetCameraSecondaryFocus(2, panelTarget);
SetCurrentCamera(2);
SetCameraFOV(90, 0, 0.0);
Sleep(0.5);
# flip panel switch texture
SetWallCel(switch, 2);
sound2 = PlaySoundLocal(sndSwitchTex, 1.0, 0.0, 0x0, 0);
WaitForSound(sound2);
Sleep(0.5);
# Cut to switch cam
SetCameraFocus(2, switchCam);
SetCameraSecondaryFocus(2, trkSwitch);
SetCurrentCamera(2);
SetCameraFOV(90, 0, 0.0);
# rotate track switch
Rotate(trkSwitch, 90, 1, 1.0);
Sleep(2.0);
# hide indy show player
SetThingFlags(indy, 0x80000);
ClearThingFlags(player, 0x80000);
# stop any unfinished animations
ResetThing(indy);
# restore controls
ClearActorFlags(player, 0x200000);
# restore camera
SetCurrentCamera(curCam);
# Destroy old lever and create a new one
DestroyThing(pulled);
pushed = CreateThing(tplLevPull, leverGhost);
CaptureThing(pushed);
# Mine Track -- turn off
SetSurfaceFlags(switchB, 0x4000);
ClearSurfaceFlags(switchA, 0x4000);
EndCutscene();
ready = 1;
# tell hintCog to check switch positions
SendMessage(hintCog, user1);
return;
# ========================================================================================
pullLever:
# do cutscene stuff
MakeMeStop();
StartCutscene(2);
# switch to offsetCam
SetCameraFocus(2, offsetCam);
SetCameraSecondaryFocus(2, player);
SetCurrentCamera(2);
SetCameraFOV(90, 0, 0.0);
# put away any weapon
DeselectWeaponWait(player);
# outfit Indy actor
CopyPlayerHolsters(player, indy);
# show actor hide player
SetThingFlags(player, 0x80000);
ClearThingFlags(indy, 0x80000);
# pull the lever
PlayKey(pushed, leverPull, 4, 0x14, 0);
PlayKey(indy, indyPull, 4, 0x12, 0);
Sleep(0.85);
PlaySoundLocal(sndLever, 1.0, 0.0, 0x0, 1);
# Cut to Control Panel cam
SetCameraFocus(2, ctrlCam1);
SetCameraSecondaryFocus(2, panelTarget);
SetCurrentCamera(2);
SetCameraFOV(90, 0, 0.0);
Sleep(0.5);
# flip panel switch texture
SetWallCel(switch, 1);
sound2 = PlaySoundLocal(sndSwitchTex, 1.0, 0.0, 0x0, 0);
WaitForSound(sound2);
Sleep(0.5);
# Cut to switch cam
SetCameraFocus(2, switchCam);
SetCameraSecondaryFocus(2, trkSwitch);
SetCurrentCamera(2);
# rotate track switch
SetCameraFOV(90, 0, 0.0);
Rotate(trkSwitch, -90, 1, 1.0);
Sleep(2.0);
# hide indy show player
SetThingFlags(indy, 0x80000);
ClearThingFlags(player, 0x80000);
# stop any unfinished animations
ResetThing(indy);
# restore controls
ClearActorFlags(player, 0x200000);
# restore camera
SetCurrentCamera(curCam);
# Destroy old lever and create a new one
DestroyThing(pushed);
pulled = CreateThing(tplLevPush, leverGhost);
CaptureThing(pulled);
# Mine Track -- Go Straight
SetSurfaceFlags(switchA, 0x4000);
ClearSurfaceFlags(switchB, 0x4000);
EndCutscene();
ready = 1;
# tell hintCog to check switch positions
SendMessage(hintCog, user1);
return;
# ========================================================================================
noPower:
# do cutscene stuff
MakeMeStop();
StartCutscene(2);
# switch to offsetCam
SetCameraFocus(2, offsetCam);
SetCameraSecondaryFocus(2, player);
SetCurrentCamera(2);
SetCameraFOV(90, 0, 0.0);
# put away any weapon
DeselectWeaponWait(player);
# activate lever
PlayMode(player, 60, 0);
Sleep(0.3);
# say line
PlayVoice(player, inJuice, 1.0, 1);
Sleep(0.5);
# restore controls and camera
ClearActorFlags(player, 0x200000);
SetCurrentCamera(curCam);
EndCutscene();
playing = 0;
return;
# ========================================================================================
end